package com.guoj.rabbitmq.controller;


import com.guoj.rabbitmq.entity.ResponseEntity;
import com.guoj.rabbitmq.entity.StatusCode;
import com.guoj.rabbitmq.entity.TOrder;
import com.guoj.rabbitmq.service.ITOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author guoj
 * @since 2019-05-30
 */
@RestController
@RequestMapping("/order")
public class TOrderController {

	@Autowired
	private ITOrderService orderService;

	@PostMapping
	public ResponseEntity createOrder(TOrder order) {
		orderService.createOrder(order);
		return new ResponseEntity(true, StatusCode.OK, "保存订单成功", order);
	}
}

